package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.AutoFill;
import com.ruoyi.common.enums.AutoFillType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DispatchEnergyConsumptionMapper;
import com.ruoyi.system.domain.DispatchEnergyConsumption;
import com.ruoyi.system.service.IDispatchEnergyConsumptionService;

/**
 * 能耗分析Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@Service
public class DispatchEnergyConsumptionServiceImpl implements IDispatchEnergyConsumptionService 
{
    @Autowired
    private DispatchEnergyConsumptionMapper dispatchEnergyConsumptionMapper;

    /**
     * 查询能耗分析
     * 
     * @param energyConsumptionId 能耗分析主键
     * @return 能耗分析
     */
    @Override
    public DispatchEnergyConsumption selectDispatchEnergyConsumptionByEnergyConsumptionId(Long energyConsumptionId)
    {
        return dispatchEnergyConsumptionMapper.selectDispatchEnergyConsumptionByEnergyConsumptionId(energyConsumptionId);
    }

    /**
     * 查询能耗分析列表
     * 
     * @param dispatchEnergyConsumption 能耗分析
     * @return 能耗分析
     */
    @Override
    public List<DispatchEnergyConsumption> selectDispatchEnergyConsumptionList(DispatchEnergyConsumption dispatchEnergyConsumption)
    {
        return dispatchEnergyConsumptionMapper.selectDispatchEnergyConsumptionList(dispatchEnergyConsumption);
    }

    /**
     * 新增能耗分析
     * 
     * @param dispatchEnergyConsumption 能耗分析
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int insertDispatchEnergyConsumption(DispatchEnergyConsumption dispatchEnergyConsumption)
    {
        return dispatchEnergyConsumptionMapper.insertDispatchEnergyConsumption(dispatchEnergyConsumption);
    }

    /**
     * 修改能耗分析
     * 
     * @param dispatchEnergyConsumption 能耗分析
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.UPDATE)
    @Override
    public int updateDispatchEnergyConsumption(DispatchEnergyConsumption dispatchEnergyConsumption)
    {
        return dispatchEnergyConsumptionMapper.updateDispatchEnergyConsumption(dispatchEnergyConsumption);
    }

    /**
     * 批量删除能耗分析
     * 
     * @param energyConsumptionIds 需要删除的能耗分析主键
     * @return 结果
     */
    @Override
    public int deleteDispatchEnergyConsumptionByEnergyConsumptionIds(Long[] energyConsumptionIds)
    {
        return dispatchEnergyConsumptionMapper.deleteDispatchEnergyConsumptionByEnergyConsumptionIds(energyConsumptionIds);
    }

    /**
     * 删除能耗分析信息
     * 
     * @param energyConsumptionId 能耗分析主键
     * @return 结果
     */
    @Override
    public int deleteDispatchEnergyConsumptionByEnergyConsumptionId(Long energyConsumptionId)
    {
        return dispatchEnergyConsumptionMapper.deleteDispatchEnergyConsumptionByEnergyConsumptionId(energyConsumptionId);
    }
}
